home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5848 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: gets(rec->num);  I don't know what I am doing wrong...
  5. Date: Wed, 21 Feb 96 14:39:37 GMT
  6. Organization: none
  7. Message-ID: <824913577snz@genesis.demon.co.uk>
  8. References: <4fempt$mjg@aphex.direct.ca> <3129dbf1.656738@news.iquest.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <3129dbf1.656738@news.iquest.net>
  15.            rclark@iquest.net "Robert B. Clark" writes:
  16.  
  17. >...but this not.  gets() is defined as 
  18. >
  19. >        char * gets(char *s)
  20. >
  21. >gets() expects a pointer to char and returns a pointer to char or EOF or
  22. >NULL.
  23.  
  24. EOF is a 'negative integral constant expression' which means that gets()
  25. certainly can't return it. gets() returns NULL on either end-of-file or
  26. an error condition - you can subsequently use feof() or ferror() to
  27. determine which. While this is academic for gets() (since of course you
  28. never use it) it also applies to other functions such as fgets().
  29.  
  30. -- 
  31. -----------------------------------------
  32. Lawrence Kirby | fred@genesis.demon.co.uk
  33. Wilts, England | 70734.126@compuserve.com
  34. -----------------------------------------
  35.